package org.gpf.po;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 * 
* @ClassName: ArticleDetail 
* @Description: 文章详情
* @author gaopengfei
* @date 2015-9-29 下午1:19:53 
*
 */
public class ArticleDetail {

	private int id;				// 文章id
	private String title;  		// 标题
	private String content;     // 内容
	private String author;		// 作者
	private Date pdate;			// 发布日期
	private int count;			// 访问量
	
	public ArticleDetail() {
		
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public Date getPdate() {
		return pdate;
	}
	public void setPdate(Date pdate) {
		this.pdate = pdate;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	@Override
	public String toString() {
		return "ArticleDetail [id=" + id + ", title=" + title + ", content="
				+ content + ", author=" + author + ", pdate=" + pdate
				+ ", count=" + count + "]";
	}
	
	/**
	 * 根据结果集实例化javabean
	 */
	public void initFieldsFromResultSet(ArticleDetail articleDetail,ResultSet rs) throws SQLException{
		
		articleDetail.setAuthor(rs.getString("author"));
		articleDetail.setContent(rs.getString("content"));
		articleDetail.setCount(rs.getInt("count"));
		articleDetail.setPdate(rs.getDate("pdate"));
		articleDetail.setTitle(rs.getString("title"));
		articleDetail.setId(rs.getInt("id"));
		
	}
	
}
